import request from '@/utils/request';
import { stringify } from 'qs';

//获取账期列表(待还和历史)
export async function queryAccountList(params) {
  return request(`/blade-user/ReceptionCredit/ReceptionBill`, {
    method: 'POST',
    data: params,
  });
}

//获取账期列表(未出账期)
export async function queryReturnAccountList(params) {
  return request(`/blade-user/ReceptionCredit/billsReceivables`, {
    method: 'POST',
    data: params,
  });
}

//获取账期明细
export async function queryBillDetails(params) {
  return request(`/blade-user/ReceptionCredit/billDetails`, {
    method: 'POST',
    data: params,
  });
}

//账期还款预览
export async function repaymentView(params) {
  return request(`/zjf-pays/credit/pay/repaymentView?${stringify(params)}`);
}

//至信链接口详情
export async function getZxlDetailsOp(params) {
  // return request(`/zjf-pays/zxldata/detail?${stringify(params)}`);
  return request(`/zjf-pays/log/details?${stringify(params)}`);
}

//账期还款
export async function payCredit(params) {
  return request(`/blade-user/client/erp/repayment`, {
    method: 'POST',
    data: params,
  });
}

//提前出账
export async function createNewBill(params) {
  return request(`/blade-user/client/appCredit/createNewBill`, {
    method: 'POST',
    data: params,
  });
}

//查看账期日志
export async function queryCreditLog(params) {
  return request(`/blade-user/contract/creditLog?${stringify(params)}`);
}

//账期优惠申请
export async function creditdiscountApply(params) {
  return request(`/zjf-pays/creditdiscount/apply`, {
    method: 'POST',
    data: params,
  });
}

//账期优惠修改
export async function creditdiscountModify(params) {
    return request(`/zjf-pays/creditdiscount/modify`, {
      method: 'POST',
      data: params,
    });
  }

//账期优惠撤销
export async function creditdiscountRevoke(params) {
    return request(`/zjf-pays/creditdiscount/revoke`, {
      method: 'POST',
      data: params,
    });
  }

  ////////账期对账
  //pc端对账明细分页
export async function getCheckBillTableListOp(params) {
  return request(`/zjf-pays/credit/reconciliation/page?${stringify(params)}`);
}

  //pc端对账金额明细统计
  export async function getStaticNumberOp(params) {
    return request(`/zjf-pays/credit/reconciliation/statistics?${stringify(params)}`);
  }